#include"vector.h"


void test_vector1()
{
	yjy::vector<int> v1;
	v1.push_back(1);
	v1.push_back(2);
	v1.push_back(3);
	v1.push_back(4);
	v1.push_back(4);
	v1.push_back(4);

	for (size_t i = 0; i < v1.size(); i++)
	{
		cout << v1[i] << " ";
	}
	cout << endl;

	for (auto e : v1)
	{
		cout << e << " ";
	}
	cout << endl;

	v1.pop_back();
	v1.pop_back();
	v1.pop_back();
	v1.pop_back();
	v1.pop_back();
	v1.pop_back();
	//v1.pop_back();

	yjy::vector<int>::iterator it1 = v1.begin();
	while (it1 != v1.end())
	{
		cout << *it1 << " ";
		++it1;
	}
	cout << endl;
}

void test_vector2()
{
	yjy::vector<int> v1;
	v1.push_back(1);
	v1.push_back(2);
	v1.push_back(3);
	v1.push_back(4);
	v1.push_back(5);

	for (auto e : v1)
	{
		cout << e << " ";
	}
	cout << endl;

	v1.insert(v1.begin() + 2, 30);

	for (auto e : v1)
	{
		cout << e << " ";
	}
	cout << endl;

	yjy::vector<int> v2 = { 1,2,3,4,5,6 };
	for (auto e : v2)
	{
		cout << e << " ";
	}
	cout << endl;

}

int main()
{
	test_vector1();
	test_vector2();

	return 0;
}